<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width = device-width,initial-scale=1.0">
    <title></title>
</head>
<body>
<img id="myImg" src="" alt="" style="width:200px;height: 200px;">
<input id="login"/>
<button onclick="openPhoto()">打开相册</button>
<script>
    //打开相册方法
    function openPhoto(){
        if(window.myPhoto){
            window.myPhoto.openAlbum("getPhoto")
        }
    }
    function test (value){
        document.querySelector("#login").value = value
    }
    function getPhoto (url){
        document.querySelector("#myImg").src = url
    }
</script>
</body>
</html>